package teacher.service.laohe;

import java.util.List;

import com.opensymphony.xwork2.ActionContext;

import teacher.bean.Teacher;
import teacher.bean.Treatise;

public class TreatiseShow {
	private int flag;
	private List<Treatise> treatises;
	public int getFlag() {
		return flag;
	}
	public void setFlag(int flag) {
		this.flag = flag;
	}
	public List<Treatise> getTreatises() {
		return treatises;
	}
	public void setTreatises(List<Treatise> treatises) {
		this.treatises = treatises;
	}
	public String execute()
	{
		Treatise treatise =new Treatise();
		Teacher tea=(Teacher)ActionContext.getContext().getSession().get("teacher");
		if(flag==0)
		{
			treatise.setClass_(0);
			this.setTreatises(new ListShow().getTreatiseByUser(treatise, null, tea));
		}
		else if(flag==1)
		{
			treatise.setClass_(1);
			this.setTreatises(new ListShow().getTreatiseByUser(treatise, null, tea));
		}
		else if(flag==2)
		{
			treatise.setClass_(2);
			this.setTreatises(new ListShow().getTreatiseByUser(treatise, null, tea));
		}
	    else if(flag==3)
		{
			treatise.setClass_(3);
			this.setTreatises(new ListShow().getTreatiseByUser(treatise, null, tea));
		}
		return "succ";
		
	}
	
	
}
